﻿using System.Collections.Generic;

namespace NewfarTormentTool.core
{
    /// <summary>
    /// 角色配置
    /// <para>
    /// -- id规范 星级(1位)-属性(1位-国度(1位))-序号(2位) 爷为0
    /// </para>
    /// 星级
    /// <list type="bullet">
    ///     <item>1:5星</item>
    ///     <item>2:4星</item>
    /// </list>
    /// 属性
    /// <list type="bullet">
    ///     <item>1:岩</item>
    ///     <item>2:风</item>
    ///     <item>3:冰</item>
    ///     <item>4:雷</item>
    ///     <item>5:草</item>
    ///     <item>6:水</item>
    ///     <item>7:火</item>
    /// </list>
    /// 国度
    /// <list type="bullet">
    ///     <item>1:蒙德</item>
    ///     <item>2:璃月</item>
    ///     <item>3:稻妻</item>
    ///     <item>4:须弥</item>
    ///     <item>5:枫丹</item>
    ///     <item>6:纳塔</item>
    ///     <item>7:至冬</item>
    /// </list>
    /// </summary>
    public class RoleConfig
    {
        /// <summary>
        /// ID
        /// </summary>
        public int id { get; set; }
        /// <summary>
        /// 语言 -> 名字
        /// </summary>
        public Dictionary<string, string> name { get; set; }

        public RoleConfig() 
        { 
            name = new Dictionary<string, string>();
        }

        /// <summary>
        /// 显示名
        /// </summary>
        /// <param name="lang">语言</param>
        public string ShowName(string lang)
        {
            string n;
            bool exist = name.TryGetValue(lang, out n);
            if (!exist)
            {
                return "???";
            }
            return n;
        }
    }
}
